<template>
  <div class="operate-center">
    <div class="map"></div>
    <div class="show-data">
      <div class="one-line">
        <div class="left">
          <div class="name">11<span>个</span></div>
          <div class="val">变电所数量</div>
        </div>
        <div class="right">
          <div class="name">278000<span>KVA</span></div>
          <div class="val">变压器总容量</div>
        </div>
      </div>
      <div class="two-line">
        <div class="left">
          <div class="name">755<span>kW</span></div>
          <div class="val">当前总功率</div>
        </div>
        <div class="right">
          <div class="name">651<span>kW·h</span></div>
          <div class="val">当日总用电</div>
        </div>
      </div>
      <div class="three-line">
        <div class="left">
          <div class="name">191<span>个</span></div>
          <div class="val">网关数量</div>
        </div>
        <div class="right">
          <div class="name">191<span>个</span></div>
          <div class="val">仪表数量</div>
        </div>
      </div>
      <div class="four-line">
        <div class="left">
          <div class="name">6<span>个</span></div>
          <div class="val">当日报警</div>
          <div class="top">遥测越限</div>
        </div>
        <div class="right">
          <div class="name">0<span>个</span></div>
          <div class="val">当日报警</div>
          <div class="top">遥信变位</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, reactive, onMounted } from "vue";
onMounted(() => {
  var map = new BMapGL.Map(document.querySelector(".map")); // 创建地图实例
  var point = new BMapGL.Point(112.42, 114.14); // 创建点坐标
  map.centerAndZoom(point, 15);
  map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
  // map.setMapType(BMAP_NORMAL_MAP); //变更地图模型
  map.setMapType(BMAP_EARTH_MAP); //变更地图模型

  var scaleCtrl = new BMapGL.ScaleControl(); // 添加比例尺控件
  map.addControl(scaleCtrl);
  var zoomCtrl = new BMapGL.ZoomControl(); // 添加缩放控件
  map.addControl(zoomCtrl);
  // var cityCtrl = new BMapGL.CityListControl(); // 添加城市列表控件
  // map.addControl(cityCtrl);
});
</script>
<style lang="scss" scoped>
.operate-center {
  padding: 15px 17px 20px 17px;
  width: 100%;
  height: 100%;
  position: relative;
  .map {
    width: 100%;
    height: 100%;
  }
  .show-data {
    position: absolute;
    width: 381px;
    padding: 45px 0 51px 0;
    top: 68px;
    right: 57px;
    height: 525px;
    background: rgba(0, 0, 0, 0.66);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 999;
    /* .one-line {
      margin-top: 45px;
    } */
    /* .two-line {
      margin-top: 56px;
    }
    .three-line {
      margin-top: 54px;
    }
    .four-line {
      margin-top: 44px;
    } */
    .one-line,
    .two-line,
    .three-line,
    .four-line {
      display: flex;
      justify-content: space-evenly;
      align-items: center;
      .left {
        width: 105px;
        margin-left: 46px;
      }
      .right {
        width: 156px;
        margin-left: 58px;
        margin-right: 20px;
      }
      .left,
      .right {
        .top {
          font-size: 20px;
          font-weight: 400;
          margin-top: 3px;
          color: #ffffff;
          text-align: center;
        }
        .name {
          font-size: 34px;
          font-weight: bold;
          color: #f8e000;
          text-align: center;
          span {
            color: #fff;
            font-size: 16px;
            font-weight: 0 !important;
          }
        }
        .val {
          font-size: 20px;
          font-weight: 400;
          font-family: Source Han Sans CN;
          color: #ffffff;
          text-align: center;
          margin-top: 15px;
        }
      }
      .right {
      }
    }
  }
}
</style>
